package cn.tedu.csmall.product.pojo.dto;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * 添加相册的DTO类
 *
 * @author liuweitao
 *
 * @version 1.0.0
 */
@Data
@Accessors(chain = true)
public class AlbumAddNewDTO implements Serializable {

    /**
     * 相册的名称
     */
    @ApiModelProperty(value = "相册的名称",required = true,example = "小米10的相册")
    @NotNull(message = "添加相册失败，必须提交相册名称！")
    private String name;


    /**
     * 简介
     */
    @ApiModelProperty(value = "简介",required = true,example = "小米10的相册的简介")
    @NotNull(message = "添加相册失败，必须提交相册简介！")
    @NotBlank(message = "不能为空格符")//只能作用与字符串类型
    private String description;

    /**
     * 排序序号
     */
    @ApiModelProperty(value = "排序序号",required = true,example = "20")
    @NotNull(message = "添加相册失败，必须提交排序序号！")
//    @NotEmpty(message = "不允许为空")//只能作用与字符串类型
    @Range(min = 0,max = 255,message = "最小0，最大255，输入正确的数值")
    private Integer sort;
}
